<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/djerp/dj_base_data/dj_stpo.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/djerp/dj_base_data/dj_stpo.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'dj_stpo_id',
                footer: "Foots",
                cnName: 'BOM编辑',
                name: 'dj_base_data/dj_stpo',
                url: "/dj_stpo/",
                sortName: "matnr"
            });
            const editFormFields = ref({"idnrk":"","posnr":"","sorft":"","menge":"","matnr":"","datuv":"","datub":""});
            const editFormOptions = ref([[{"title":"子物料编码","field":"idnrk"},
                               {"title":"行项目号","field":"posnr"}],
                              [{"title":"工位","field":"sorft"},
                               {"title":"数量","field":"menge","type":"decimal"}],
                              [{"title":"父物料编码","field":"matnr"},
                               {"title":"有效终止日期","field":"datuv","type":"date"}],
                              [{"title":"有效起始日期","field":"datub","type":"date"}]]);
            const searchFormFields = ref({"idnrk":"","sorft":"","matnr":"","datuv":"","datub":""});
            const searchFormOptions = ref([[{"title":"子物料编码","field":"idnrk","type":"like"},{"title":"工位","field":"sorft"}],[{"title":"父物料编码","field":"matnr","type":"like"},{"title":"有效终止日期","field":"datuv","type":"date"}],[{"title":"有效起始日期","field":"datub","type":"date"}]]);
            const columns = ref([{field:'dj_stpo_id',title:'物料BOM',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'idnrk',title:'子物料编码',type:'string',link:true,width:180,align:'left',sort:true},
                       {field:'posnr',title:'行项目号',type:'string',width:180,align:'left'},
                       {field:'sorft',title:'工位',type:'string',width:180,align:'left'},
                       {field:'menge',title:'数量',type:'decimal',width:110,align:'left'},
                       {field:'matnr',title:'父物料编码',type:'string',width:220,align:'left'},
                       {field:'datuv',title:'有效终止日期',type:'date',width:110,align:'left'},
                       {field:'datub',title:'有效起始日期',type:'date',width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
